/ Assembly List / LJCNetCommon / NetCommon / GetInt32

Namespace - LJCNetCommon


Parameters
value - The value object.

Returns

The integer value or zero if the object is null. Also returns zero if the object is not type "int" or "short".

Syntax

C#
public static Int32 GetInt32(Object value)

Gets an integer value from an object. (E)

Example

C#
using LJCNetCommon;
        
// Gets an int value from an object.
private static void GetInt32()
{
  // Simulates an Object value like that received from a DataTable.
  int setup = 3;
  object obj = setup;

  // Gets an int value from an object.
  int value = NetCommon.GetInt32(obj);
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.